	/**
	 * 检验申请单js
	 */

	var yangbenselect;
	var tableList1; //第一个的数据
	var tableList2; //第二个的数据
	var tableList3; //第三个的数据
//	var table1List;
	function L1()
	{
		var url1=rootUrl+"/doctoradviceeditor/yangben" ;
		var params1={} ;
		$.get(url1,params1,function(data)
				{
				//样本列表
				yangbenList = data.list;
				yangbenselect = "<select>";
				for(var j = 0; j<yangbenList.length; j++)
				{
					var option = "<option value='"+yangbenList[j]['abb01']+"' >"+yangbenList[j]['abb02']+"</option>";
					yangbenselect += option;
				}
				yangbenselect += "</select>";
				////////////////////////////////////页签1
				
				var url =rootUrl+"/doctoradviceeditor/requestnote";;
				var params = {};
				params.lACF01 = 1;
				params.lBCE01 = bce01;
				params.currPage = 1;
				params.pageSize = 100;
				$.ajax({
					url : url,
					type : "post",
					async : true, 
					data : params,
					dataType : 'json',
					success : function(data) {
						$("#L11_left").empty();
					    var rows  = data.rows;//bdo03
					    tableList1 = data.list;
						for(var j = 0;j<rows.length;j++)
						{
							var li = $("<li onclick=\"L11Table('"+rows[j]+"')\">");
							var span1=$("<sapn>").attr({class:"glyphicon glyphicon-chevron-right"});
							var span = $("<sapn>").text(rows[j]);
							li.append(span1);
							li.append(span);
							//ul.append(li);
							$("#L11_left").append(li);
						}
					}
				});
				//查询组合及自定义项目
				////////////////////////////////////页签二
				var url1 =rootUrl+"/doctoradviceeditor/rapeuticschedule";;
				var params1 = {};
				params1.lACF01 = 1;
				params1.lBCE01 = bce01;
				$.ajax({
					url : url1,
					type : "post",
					async : true, 
					data : params1,
					dataType : 'json',
					success : function(data) {
						$("#L21_left").empty();
						var bdoList = data.list;
						tableList2 = data.rows;
						for(var i = 0;i<bdoList.length;i++)
						{
							var li = $("<li onclick=\"L21Table("+bdoList[i]["bdo01"]+")\">").attr({id:bdoList[i]["bdo01"]});
							var span1=$("<sapn>").attr({class:"glyphicon glyphicon-chevron-right"});
							var span = $("<sapn>").text(bdoList[i]["bdo03"]);
							li.append(span1);
							li.append(span);
							$("#L21_left").append(li);
						}
					}
				});
				///////////////////////////////页签三
				var url2 =rootUrl+"/doctoradviceeditor/requestnotedetailitem";;
				var params2 = {};
				params2.lACF01 = 1;
				params2.lBCE01 = bce01;
				params2.currPage = 1;
				params2.pageSize = 100;
				$.ajax({
					url : url2,
					type : "post",
					async : true, 
					data : params2,
					dataType : 'json',
					success : function(data) {
						$("#L31_left").empty();
						tableList3 = data.list;
						var row = data.rows;
						for (var k=0;k<row.length;k++){
							var li = $("<li onclick=\"L31Table('"+row[k]+"')\">");
							var span1=$("<sapn>").attr({class:"glyphicon glyphicon-chevron-right"});
							var span = $("<sapn>").text(row[k]);
							li.append(span1);
							li.append(span);
							$("#L31_left").append(li);
						}
					}
				});
				
				});
		
	}
	
	//页签1中tree和table交互事件
	function L11Table(id)
	{
		var resultList = [];
		for(var i = 0;i<tableList1.length;i++)
		{
			if(id == tableList1[i]["bdo03"])
			{
				resultList.push(tableList1[i]);
			}
		}
		$("#L11_Table").empty();
		configTr("L11_Table",resultList);
	}
	//页签2中tree和table交互事件
	function L21Table(id)
	{
		var resultList = [];
		for(var i = 0;i<tableList2.length;i++)
		{
			if(id == tableList2[i]["bdo01"])
			{
				resultList.push(tableList2[i]);
			}
		}
		
		$("#L21_Table").empty();
		configTr("L21_Table",resultList);
	}
	
	//页签3中tree和table交互事件
	function L31Table(id)
	{
		var resultList = [];
		for(var i = 0;i<tableList3.length;i++)
		{
			if(id == tableList3[i]["bdo03"])
			{
				resultList.push(tableList3[i]);
			}
		}
		$("#L31_Table").empty();
		configTr("L31_Table",resultList);
	}
	
	//根据list构造table
	function configTr(tableId,list)
	{
		
		for(var i = 0;i<list.length;i++)
		{
			var bda01 = list[i]["bda01"];
			var bbx01 = list[i]["bbx01"];
			var bbx04 = list[i]["bbx04"];
			var bdg02 = list[i]["bdg02"];
			var bbx06 = list[i]["bbx06"];
			var arr = {};
			arr.bda01 = bda01;
			arr.bbx01 = bbx01;
			arr.bbx04 = bbx04;
			arr.bdg02 = bdg02;
			arr.bbx06 = bbx06;
			var checkbox = $("<input type='checkbox' data-info='"+JSON.stringify(arr)+"'/>");
			var span = $("<span></span>");
			span.append(list[i]["bbx05"]);
			var td = $("<td></td>");
			var div = $("<div style='position:relative;width:100%;height:100%'></div>");
			td.append(div);
			div.append(checkbox);
			div.append(span);
			div.append(yangbenselect);
//			var tr = $("<tr></tr>");
//			tr.append(td);
			//排列<td>,按照每行3列排
			if(i%3==0)
			{
				var tr = $("<tr></tr>");
			}
			tr.append(td);
			$("#"+tableId).append(tr);
		}
		$("select").select2({
			
		});
	}
	
	
